3.986 \(\int \frac{\left (1-\frac{x}{a}\right )^{-n/2} \left (1+\frac{x}{a}\right )^{n/2}}{x^2} \, dx\)

Optimal. Leaf size=70 \[ -\frac{4 \left (1-\frac{x}{a}\right )^{1-\frac{n}{2}} \left (\frac{x}{a}+1\right )^{\frac{n-2}{2}} \, _2F_1\left (2,1-\frac{n}{2};2-\frac{n}{2};\frac{a-x}{a+x}\right )}{a (2-n)} \]

[Out]

(-4*(1 - x/a)^(1 - n/2)*(1 + x/a)^((-2 + n)/2)*Hypergeometric2F1[2, 1 - n/2, 2 -
 n/2, (a - x)/(a + x)])/(a*(2 - n))

_______________________________________________________________________________________

Rubi [A]  time = 0.0592106, antiderivative size = 70, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.032 \[ -\frac{4 \left (1-\frac{x}{a}\right )^{1-\frac{n}{2}} \left (\frac{x}{a}+1\right )^{\frac{n-2}{2}} \, _2F_1\left (2,1-\frac{n}{2};2-\frac{n}{2};\frac{a-x}{a+x}\right )}{a (2-n)} \]

Antiderivative was successfully verified.

[In]  Int[(1 + x/a)^(n/2)/(x^2*(1 - x/a)^(n/2)),x]

[Out]

(-4*(1 - x/a)^(1 - n/2)*(1 + x/a)^((-2 + n)/2)*Hypergeometric2F1[2, 1 - n/2, 2 -
 n/2, (a - x)/(a + x)])/(a*(2 - n))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 7.21617, size = 44, normalized size = 0.63 \[ - \frac{4 \left (1 - \frac{x}{a}\right )^{- \frac{n}{2} + 1} \left (1 + \frac{x}{a}\right )^{\frac{n}{2} - 1}{{}_{2}F_{1}\left (\begin{matrix} - \frac{n}{2} + 1, 2 \\ - \frac{n}{2} + 2 \end{matrix}\middle |{\frac{- a + x}{- a - x}} \right )}}{a \left (- n + 2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((1+x/a)**(1/2*n)/x**2/((1-x/a)**(1/2*n)),x)

[Out]

-4*(1 - x/a)**(-n/2 + 1)*(1 + x/a)**(n/2 - 1)*hyper((-n/2 + 1, 2), (-n/2 + 2,),
(-a + x)/(-a - x))/(a*(-n + 2))

_______________________________________________________________________________________

Mathematica [C]  time = 0.318252, size = 139, normalized size = 1.99 \[ -\frac{4 \left (\frac{a+x}{a}\right )^{n/2} \left (1-\frac{x}{a}\right )^{-n/2} F_1\left (1;-\frac{n}{2},\frac{n}{2};2;-\frac{a}{x},\frac{a}{x}\right )}{4 x F_1\left (1;-\frac{n}{2},\frac{n}{2};2;-\frac{a}{x},\frac{a}{x}\right )+a n \left (F_1\left (2;1-\frac{n}{2},\frac{n}{2};3;-\frac{a}{x},\frac{a}{x}\right )+F_1\left (2;-\frac{n}{2},\frac{n+2}{2};3;-\frac{a}{x},\frac{a}{x}\right )\right )} \]

Warning: Unable to verify antiderivative.

[In]  Integrate[(1 + x/a)^(n/2)/(x^2*(1 - x/a)^(n/2)),x]

[Out]

(-4*((a + x)/a)^(n/2)*AppellF1[1, -n/2, n/2, 2, -(a/x), a/x])/((1 - x/a)^(n/2)*(
4*x*AppellF1[1, -n/2, n/2, 2, -(a/x), a/x] + a*n*(AppellF1[2, 1 - n/2, n/2, 3, -
(a/x), a/x] + AppellF1[2, -n/2, (2 + n)/2, 3, -(a/x), a/x])))

_______________________________________________________________________________________

Maple [F]  time = 0.17, size = 0, normalized size = 0. \[ \int{\frac{1}{{x}^{2}} \left ( 1+{\frac{x}{a}} \right ) ^{{\frac{n}{2}}} \left ( \left ( 1-{\frac{x}{a}} \right ) ^{{\frac{n}{2}}} \right ) ^{-1}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((1+x/a)^(1/2*n)/x^2/((1-x/a)^(1/2*n)),x)

[Out]

int((1+x/a)^(1/2*n)/x^2/((1-x/a)^(1/2*n)),x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (\frac{x}{a} + 1\right )}^{\frac{1}{2} \, n}{\left (-\frac{x}{a} + 1\right )}^{-\frac{1}{2} \, n}}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x/a + 1)^(1/2*n)/(x^2*(-x/a + 1)^(1/2*n)),x, algorithm="maxima")

[Out]

integrate((x/a + 1)^(1/2*n)*(-x/a + 1)^(-1/2*n)/x^2, x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{\left (\frac{a + x}{a}\right )^{\frac{1}{2} \, n}}{x^{2} \left (\frac{a - x}{a}\right )^{\frac{1}{2} \, n}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x/a + 1)^(1/2*n)/(x^2*(-x/a + 1)^(1/2*n)),x, algorithm="fricas")

[Out]

integral(((a + x)/a)^(1/2*n)/(x^2*((a - x)/a)^(1/2*n)), x)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((1+x/a)**(1/2*n)/x**2/((1-x/a)**(1/2*n)),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (\frac{x}{a} + 1\right )}^{\frac{1}{2} \, n}}{x^{2}{\left (-\frac{x}{a} + 1\right )}^{\frac{1}{2} \, n}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x/a + 1)^(1/2*n)/(x^2*(-x/a + 1)^(1/2*n)),x, algorithm="giac")

[Out]

integrate((x/a + 1)^(1/2*n)/(x^2*(-x/a + 1)^(1/2*n)), x)